package com.wu.service;

import com.wu.dao.UserDao;
import com.wu.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author wuyanshen
 * @date 2019-01-21 11:28 AM
 * @discription 描述
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

//    public void setUserDao(UserDao userDao) {
//        this.userDao = userDao;
//    }

    @Transactional(readOnly = false,rollbackFor = Exception.class)
    public User getUser(User user) {
        System.out.println("UserService执行了");
        user = this.userDao.getUser(user);
        int i = 1/0;
        return user;
    }
}
